package ch6;

import java.util.Scanner;

public class GetNewOrder {

	public static void main(String[] args) {
		int[] s = { 34, 56, 78, 89, 90, 0 };// 0认为是空位置
		Scanner in = new Scanner(System.in);
		int nk = in.nextInt();
		int index = 0;
		for (; index < s.length - 1; index++) {
			if (s[index] > nk) {
				break;
			}
		}
		System.out.println("找到了新值的位置：" + index);
		// 从index到length-2位置上的值后移一位
		for (int j = s.length - 2; j >= index; j--) {
			s[j + 1] = s[j];//
		}
		s[index] = nk;
		for (int i = 0; i < s.length; i++) {
			System.out.print(s[i] + "  ");
		}
	}

}
